namespace Collaboris.Saf.Actions.Wss.Tests.Generated
{
    using Engine.Report;

    using Microsoft.SharePoint;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Saf.Tests;
    using Entities;

    using Sharepoint.WSS.ContentTypes;

    using Wss.ContentType;

    /// <summary>
    /// This test was originally generated but has now been tested and verfiied by MJ
    /// </summary>
    [TestClass]
    public class EnsureContentTypeTest
    {

        [TestMethod]
        public void EnsureContentType_Test()
        {
            WSSTestAssistant<EnsureContentType, ElementsInfo> ensurecontenttype =
                    new WSSTestAssistant<EnsureContentType, ElementsInfo>(TestEnvironment.PublishingSite, 
                        "EnsureContentTypeTestWeb", "BLANKINTERNET#0");

            using (ensurecontenttype)
            {
                
                ensurecontenttype.FirstEntity.FilePath = ensurecontenttype.FirstSupportingFilePath;

                MacroReport doReport = ensurecontenttype.DoMacro();

                SPContentType newCtype = SPContentTypeHelper.GetContentType(
                    ensurecontenttype.TestWeb,
                    new SPContentTypeId("0x0100D60A04C924DAF344866716D2C8E26ABD00A69AA3A3412BB44F8B87DB959C4D92FB"));

                Assert.IsNotNull(newCtype);

                MacroReport unDoReport = ensurecontenttype.UndoMacro();

                SPContentType goneCtype = SPContentTypeHelper.GetContentType(
                    ensurecontenttype.TestWeb,
                    new SPContentTypeId("0x0100D60A04C924DAF344866716D2C8E26ABD00A69AA3A3412BB44F8B87DB959C4D92FB"));

                Assert.IsNull(goneCtype);
            }
        }

    }
}
